<template>
    <el-button  type="primary"  plain @click="goTo(stock)">{{ stock }}</el-button>
</template>

<script setup>
import router, { openNewTableWeekDetail } from '../router'
import { weekStockSearch } from '../stores/week'
import { storeToRefs } from 'pinia';

const props = defineProps({
    stock: String
})

const stockSearchStore = weekStockSearch()
let { input } = storeToRefs(stockSearchStore)

const goTo = (stock) => {
    input.value = stock
    openNewTableWeekDetail(stock)
}
</script>